package com.bwie.bwedu.volley;

import com.google.gson.Gson;

/**
 * Created by gateway on 2016/6/27.
 */
public class GsonUtils {
    //构造方法私有化
    private GsonUtils(){

    }
    private static GsonUtils instance=null;
    public static  synchronized GsonUtils getInstance(){
        if(instance==null){
            instance=new GsonUtils();
        }
        return instance;
    }

    public static<T> T jsonToObjeck(String json ,Class<T> t){
        if(json==null){
            return null;
        }
        return new Gson().fromJson(json,t);
    }

}
